<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<ul class="u">
			<li class="i" index="1">1</li>
			<li class="i" index="2">2</li>
			<li class="i" index="3">3</li>
			<li class="i" index="4">4</li>
		</ul>
		
		<select>
			<option >1</option>
			<option >2</option>
			<option selected>3</option>
			<option >4</option>
			
		</select>
		
		
		
		<script>
			//函数未定义形参，当实参传入时可通过arguments获取传入的实参
			 function test() 
			   { 
				  console.log(arguments)
			      var arg = Array.prototype.slice.call(arguments,1); 
			    console.log(arg)
			   } 
			   test("a","b","c","d"); //b,c,d
			   
			   
				let a = document.querySelectorAll(".i")//获取所有class为i的元素并存在数组中
				let b = document.querySelector(".i")//获取class为i的第一个元素
				console.log(a)
				console.log(b)
			  console.log(a[2].getAttribute("index"))
			  console.log(b.getAttribute("index"))
			  
		</script>
	</body>
</html>
